import request from '@/utils/request'
import requestUpload from "@/utils/request-upload";
import requestApriso from "@/utils/request-apriso";

export function sopList(query) {
  return request({
    url: '/vue-element-admin/article/list',
    method: 'post',
    params: query
  })
}

export function getFileToken(appValue) {
  return requestUpload({
    url: '/v2/oauth/token',
    method: 'post',
    headers: {
      'Authorization': 'Basic '+appValue
    },
    params: {
      'slug': 'bop.system',
      'grant_type': 'client_with_su',
      'scope': 'all'
  }
  })
}
export function getFileInfo(params){
  return requestUpload({
    url: '/v2/api/file/path',
    method: 'post',
    headers: {
      'Authorization': 'Bearer '+localStorage.getItem('access_token')
    },
    params: params
  })
}

export function getFileUrl(neid,params){
  return requestUpload({
    url: '/v2/api/preview/'+neid,
    method: 'post',
    headers: {
      'Authorization': 'Bearer '+localStorage.getItem('access_token')
    },
    params: params
  })
}

export function getSopAndProblemList(params) {
  return requestApriso({
    url: '/Apriso/httpServices/operations/SopAndProblemlist',
    method: 'post',
    data: params
  })
}

